package thread_test;
//生产者
public class Producer extends Thread{
    Stack stack = null;

    public Producer(Stack stack) {
        this.stack = stack;
    }

    @Override
    public void run(){
        while (true){
            System.out.println("生产者生产了一个商品");
            stack.Push(new Object());
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}
